package com.yq.day29;

/**
 * @author 3307235355@qq.com
 * @description 验证wait的使用条件
 * @since 2022/06/29 09:27
 */
public class Demo02 {

    public static void main(String[] args) {
        Object o = new Object();
        synchronized (o) {
            System.out.println("in sync");
            try {
                System.out.println("wait before");
                o.wait();
                System.out.println("after");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}

class A {
}
